package com.eurekaexample.eurekaclient;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RefreshScope
@RestController
public class HiController {
    @Value("${server.port}")
    String port;
    @Value("${foo}")
    String foo;
    @GetMapping("/hi")
    public String Home(@RequestParam String name){
        return String.format("hi %s , from %s",name,port);
    }

    @GetMapping("/foo")
    public String foo(){
        return foo;
    }
}
